package basica.academico;

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import basica.administrativo.Pessoa;

@Entity
@DiscriminatorValue("ALN")
public class Aluno extends Pessoa {
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name="CodTurma", insertable=true, updatable=true)	
	@Fetch(FetchMode.JOIN)
	private Turma turma;
	
	@Column(name = "MatriculaAluno", nullable = true, unique = true, length = 10)
	private int matricula;

	public Aluno() {

	}

	public int getMatricula() {
		return matricula;
	}

	public void setMatricula(int matricula) {
		this.matricula = matricula;
	}

	public Turma getTurma() {
		return turma;
	}

	public void setTurma(Turma turma) {
		this.turma = turma;
	}

}
